package com.qidian.buy.goods.controller;

import com.qidian.buy.common.pojo.BuyResult;
import com.qidian.buy.goods.service.IItemSpecificationItemService;
import com.qidian.buy.pojo.ItemSpecificationItem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 戴着假发的程序员
 * @company 起点编程
 * @date 2024/7/17 10:13
 */
@CrossOrigin
@RestController
@RequestMapping("/speItem")
public class ItemSpecificationItemController {
    @Autowired
    private IItemSpecificationItemService speItemService;

    @GetMapping("/list")
    public BuyResult list(Long speId){
        return speItemService.listSpeItem(speId);
    };

    @PostMapping("/save")
    public BuyResult save(@RequestBody ItemSpecificationItem speItem){
        return speItemService.saveSpeItem(speItem);
    }
}
